package com.cloud.school.app.util;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;


public class Paginator implements Serializable {
    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(Long totalSize) {
        this.totalSize = totalSize;
    }

    /**
     * 当前页
     */
    @ApiModelProperty("当前页数")
    private Integer currentPage = 1;
    /**
     * 每页数量
     */
    @ApiModelProperty("每页数量")
    private Integer pageSize = 20;
    /**
     * 总页数
     */
    @ApiModelProperty("总页数")
    private Integer totalPage = 0;
    /**
     * 总数量
     */
    @ApiModelProperty("总数量")
    private Long totalSize = 0l;

    public int from() {
        return (this.currentPage - 1) * this.pageSize;
    }

    public int to() {
        return this.currentPage * this.pageSize;
    }
}
